﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Collections.ObjectModel;

namespace BusinessObjects
{
#if Silverlight
    [Serializable]
#else
    [DataContract]
#endif
    public class Bin : BaseBusinessObject
    {
        private int materialId;
        private string name;
        private List<Rubbish> contentItems;

        public String Name
        {
            get
            {
                return this.name;
            }
            set
            {
                if ( this.name == value )
                    return;

                this.name = value;
                this.NotifyPropertyChanged( "Name" );
            }
        }

        public int MaterialId
        {
            get
            {
                return this.materialId;
            }
            set
            {
                if ( this.materialId == value )
                    return;

                this.materialId = value;
                this.NotifyPropertyChanged( "MaterialId" );
            }
        }

        public List<Rubbish> ContentItems
        {
            get
            {
                if ( this.contentItems == null )
                    this.contentItems = new List<Rubbish>();

                return this.contentItems;
            }
            set
            {
                if ( this.contentItems == value )
                    return;

                this.contentItems = value;
                this.NotifyPropertyChanged( "ContentItems" );
            }
        }
    }
}
